<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

/**
 * Init Model
 *
 */
class Admin_module_model extends CI_Model {
    /**
     * User data, stored for embeded methods
     *
     * @access 	private
     * @var 	array
     */

    /**
     * Constructor
     *
     * @uses 	get_settings
     * @return 	void
     */
    function __construct() {
        parent::__construct();
        log_message('debug', 'Init Model Initialized');
    }
    
    
    
    function get_modules($status = 0,  $num=NULL, $offset = NULL) {
    
    	
    	$sql = "Select * from modules where status=$status";
    	$query = $this->db->query($sql);
    	return $query->result();
    
    }
    function change_status($id, $status) {
    	if ($status == 0) {
    		$sql = "update modules set status=51 where id=$id";
    	}
    	if ($status == 51) {
    		$sql = "update modules set status=0 where id=$id";
    	}
    	$this->db->query($sql);
    }
    
}